/**
* removes whitespaces from strings
* @param String s, String
* @return String s, without whitespaces
*/
function trim(s) {
	while (s.substring(0,1) == ' ') {
		s = s.substring(1,s.length);
	}
	while (s.substring(s.length-1,s.length) == ' ') {
		s = s.substring(0,s.length-1);
	}
	return s;
}

/**
* checks the input of both textfields before submit is done. submit will only be calles, when both fields are set
* not set fields are marekd yellow
* @return boolean, True if both fields are set, false if one field is not set
*/
function CheckInput () {
	var login = this.trim(document.getElementById('logger').value);
	var password = this.trim(document.getElementById('passer').value);
	if (password == "" || login == "") {
		if (password == "") {
			document.getElementById('passer').style.backgroundColor = "#FFD21A";
		}
		if (login == "") {
			document.getElementById('logger').style.backgroundColor = "#FFD21A";
		}
		
		if (login != "") {
			document.getElementById('logger').style.backgroundColor = "#FFFFFF";
		}
		if (password != "") {
			document.getElementById('passer').style.backgroundColor = "#FFFFFF";
		}
		return false;
	}
	return true;
}

function clearPassword () {
	document.getElementById('passer').style.backgroundColor = "#FFFFFF";
}

function clearEmail () {
	document.getElementById('logger').style.backgroundColor = "#FFFFFF";
}